package com.xcity.game.buff;

import naga.x.game.template.Template;
import naga.x.game.template.TemplateException;
import naga.x.game.template.annotation.Excel;

/**
 * buff列表
 * @author yang.li
 *
 */
@Excel(value = "buff.xlsx", sheet = 0)
public class BuffTemplate extends Template {

	/** buff效果 */
	protected int effectId;

	/** buff名称 */
	protected String name;

	/** buff描述 */
	protected String desc;
	
	/** buff图标 */
	protected String icon;

	/** 持续时间(秒)(-1:永久生效) */
	protected int duration;

	/** 参数 */
	protected int[] params;

	public int getEffectId() {
		return effectId;
	}

	public void setEffectId(int effectId) {
		this.effectId = effectId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	public int[] getParams() {
		return params;
	}

	public void setParams(int[] params) {
		this.params = params;
	}
	
	public int getParameter(int index) {
		return getParameter(index, 0);
	}
	
	public int getParameter(int index, int defaultValue) {
		if (params == null || index < 0 || index >= params.length) {
			return defaultValue;
		}
		return params[index];
	}


	@Override
	public void validate() throws TemplateException {
	}
}
